<template>
  <div>
    <el-card class="container2">
      <div>
        <div
          style="display: flex; justify-content: center; align-items: center"
        >
          <el-image
            src="https://login.weixin.qq.com/qrcode/AdKRLMcaKQ=="
            class="image"
          ></el-image>
        </div>
        <div style="margin-top: 40px">
          <h2 style="text-align: center">{{user.username}}</h2>
          <div style="text-align: center; margin-top: 20px">{{user.introduce}}</div>
          <div style="text-align: center; margin-top: 20px">{{user.location}}</div>
        </div>
      </div>
      <div class="text-container">
        <div v-for="(item, index) in articleItems" :key="index">
          <div>{{ item.title }}</div>
          <h2>{{ item.num }}</h2>
        </div>
      </div>
      <div class="btn">关注我</div>
      <div class="text-container">
        <div class="btn" style="background-color: darkred;">写文章</div>
      </div>
    </el-card>
  </div>
</template>
<script>
export default {
  components: {},
  name: "",
  data() {
    return {
      articleItems: [
        {
          title: "文章",
          num: 666,
        },
        {
          title: "分类",
          num: 444,
        },
        {
          title: "标签",
          num: 222,
        },
      ],
      user: ""
    };
  },
  methods: {
    async load() {
      let res = await this.$http.get("/user/findByEmail/2592006268@qq.com")
      this.user = res.data
    }
  },
  created() {
    this.load()
  }
};
</script>
<style scoped>
.container2 {
  height: auto;
  min-width: 14em;
}
.image {
  height: 120px;
  width: 120px;
}

.text-container {
  display: flex;
  justify-content: space-between;
  text-align: center;
  margin-top: 2em;
}
.btn {
  width: 100%;
  height: 50px;
  border-radius: 25px;
  background-color: royalblue;
  text-align: center;
  line-height: 50px;
  color: white;
  transition: all 0.5s;
}


.btn:hover {
  background-color: darkblue;
}
</style>